<?php

$siteName = "";
if (isset( $_GET['siteName'] ))
{
    $siteName = $_GET['siteName'];
}

function addMenuItem( $scriptName, $itemText, & $echoText )
{
    
    global $siteName;
    $className = "";
    if ($scriptName == $siteName)
        $className = "selectedMenuLink";
    
    $echoText .= "<td><a class = \"menuLink $className\" href=\"index.php?siteName=$scriptName\" title=\"$itemText\">$itemText</a></td>";      
    
}

$home = "Domov";
$login = "Prihlásenie";
$logout = "Odhlásenie";
$reservation = "Rezervácie";
$priceList = "Cenník";
$gallery = "Galéria";
$tournaments = "Turnaje";
$visitus= "Navštívte nás na Facebooku";


if (isEnglish())
{
    $home = "Home";
    $login = "Login";
    $logout = "Logout";
    $reservation = "Reservations";
    $priceList = "Price list";
    $gallery = "Gallery";
    $tournaments = "Tournaments";
    $visitus = "Visit us on Facebook";
    
}

$echoText = "";
if (isset( $_SESSION[ 'logged_user' ] ))
{
    $filePath = "./../applogic/logout.php"; 
    $echoText .= "<a class=\"logout\" href=\"$filePath\" title=\"$logout\">$logout</a>";
}

$echoText .= "<table class=\"tableMenu\"><tr>";
    addMenuItem( "mainsites/main.php", $home, $echoText );
    addMenuItem( "mainsites/login.php", $login, $echoText );
    addMenuItem( "mainsites/reservation.php", $reservation, $echoText );
    addMenuItem( "mainsites/pricelist.php", $priceList, $echoText );
    addMenuItem( "mainsites/gallery.php", $gallery, $echoText );
    addMenuItem( "mainsites/tournaments.php", $tournaments, $echoText );
   
$echoText .= "<td> <div class=\"menuSpace\">";

$echoText .= "<a style =\"text-decoration:none;\" href=\"index.php?language=1\" title=\"English\"> <img src=\"images/en.jpg\" alt=\"En\"></a>&nbsp;";
$echoText .= "<a style =\"text-decoration:none;\" href=\"index.php?language=0\" title=\"Slovensky\"> <img src=\"images/sk.jpg\" alt=\"Sk\"></a>&nbsp;";

$echoText .= "<a href=\"http://www.facebook.com/pages/BBC-Bratislavsk%C3%A9-Bedmintonov%C3%A9-Centrum/171835512869697\"> <img class=\"facebookImg\" src=\"../images/fb.png \"alt=\"Facebook\"</a>";
$echoText .= "</div></td>";

$echoText .= "</tr></table>";
echo( "<div class=\"headerStyle\">" );
echo( $echoText );
echo( "</div>" ); 
  
?>
